package ord2.log;

import java.io.OutputStream;

/**
 *
 * @author SemiNick
 */
public final class LogSystem {
    
    public static boolean LOG;
    private static OutputStream os = System.out;
    
    public synchronized static void logMessage(String msg) {
        
        if (LOG) {
            
            try {

                os.write(msg.getBytes());
                os.write('\n');
            } catch (Exception e) {}        
        }
    }
    
    public static synchronized void setStream(OutputStream o) {
        
        os = o;
    }
}
